const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:8080',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      },
    },
    client: {
      overlay: {
        // 只关掉 ResizeObserver 相关错误
        runtimeErrors: (error) => {
          // error.message 精确匹配
          if (error?.message === 'ResizeObserver loop completed with undelivered notifications.') {
            console.error(error);
            return false;
          }
          return true;
        }
      }
    }
  }
})
